<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>extGrid文档</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="doc" id="doc">
	<table class="zebra">
      <colgroup>
      <col class="col1">
      <col class="col2">
      <col class="col3">
      </colgroup>
      <thead>
        <tr>
          <th class="parameter">名称</th>
          <th class="default">参数</th>
          <th class="note">描述</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="separate" colspan="3"><abbrev>基本API(默认this都指向grid本身)</abbrev></th>
        </tr>
        <tr>
          <th><a href="#bind">bind</a></th>
          <td>eventType,func[,scope]</td>
          <td>事件绑定<br>eventType(String):需要绑定的事件<br>func(Function):事件处理函数<br>
		  scope(Object):this作用域，默认是grid本身
		  </td>
        </tr>
		<tr>
          <th><a href="#unbind">unbind</a></th>
          <td>eventType,eventID</td>
          <td>取消事件绑定<br>eventType(String):需要取消绑定的事件<br>eventID(Number):事件ID
		  </td>
        </tr>
		<tr>
          <th><a href="#fireEvent">fireEvent</a></th>
          <td>eventType,params</td>
          <td>触发事件<br>eventType(String):需要触发的事件<br>params(Array):触发事件所带的参数
		  </td>
        </tr>
		<tr>
          <th><a href="#showLoading">showLoading</a></th>
          <td>[msg]</td>
          <td>显示Loading层<br>msg(String):提示内容
		  </td>
        </tr>
		<tr>
          <th><a href="#hideLoading">hideLoading</a></th>
          <td></td>
          <td>关闭Loading层
		  </td>
        </tr>
		<tr>
          <th><a href="#getColumnData">getColumnData</a></th>
          <td>[field,key,value]</td>
          <td>设置或获取columns的配置信息,注：部分参数设置后会立即刷新表格
		  </td>
        </tr>
		<tr>
          <th><a href="#setColumnData">setColumnData</a></th>
          <td>[field,key,value]</td>
          <td>设置或获取columns的配置信息,注：部分参数设置后会立即刷新表格
		  </td>
        </tr>
		<tr>
          <th><a href="#setColumnValue">setColumnValue</a></th>
          <td>field,key,value</td>
          <td>设置或获取columns的配置信息,注：设置后不会会立即刷新表格
		  </td>
        </tr>
		<tr>
          <th><a href="#getData">getData</a></th>
          <td></td>
          <td>取得当前grid的数据
		  </td>
        </tr>
		<tr>
          <th><a href="#onSizeChange">onSizeChange</a></th>
          <td>[width,height]</td>
          <td>设置grid大小
		  </td>
        </tr>
		<tr>
          <th><a href="#setWH">setWH</a></th>
          <td>[width,height]</td>
          <td>设置grid大小
		  </td>
        </tr>
		<tr>
          <th><a href="#onViewSizeChange">onViewSizeChange</a></th>
          <td></td>
          <td>更新视图大小
		  </td>
        </tr>
		<tr>
          <th><a href="#getRowData">getRowData</a></th>
          <td>rid[,isPK]</td>
          <td>获取行数据<br>
		  isPK(boolean):默认false,true:根据pk来索引
		  </td>
        </tr>
		<tr>
          <th><a href="#setRowData">setRowData</a></th>
          <td>rid,field,value</td>
          <td>设置行数据<br>
		  注意field并不是column的field应该是index,但是大部分情况下field和index默认是一样的，
		  建议使用setFieldValue来设置单元格内容
		  </td>
        </tr>
		<tr>
          <th><a href="#getFieldValue">getFieldValue</a></th>
          <td>rid,field</td>
          <td>获取单元格数据容
		  </td>
        </tr>
		<tr>
          <th><a href="#setFieldValue">setFieldValue</a></th>
          <td>rid,field,value</td>
          <td>设置单元格数据容,return false 则无修改
		  </td>
        </tr>
		<tr>
          <th><a href="#getSlectRows">getSlectRows</a></th>
          <td>Boolean</td>
          <td>获取选中的行<br>
		  默认是false 返回行id, 为true时返回选中的数据集
		  </td>
        </tr>
		<tr>
          <th><a href="#lockRow">lockRow</a></th>
          <td>rid</td>
          <td>锁定某行</td>
        </tr>
		<tr>
          <th><a href="#unLockRow">unLockRow</a></th>
          <td>rid</td>
          <td>取消某行的锁定</td>
        </tr>
		<tr>
          <th><a href="#lockColumn">lockColumn</a></th>
          <td>field</td>
          <td>锁定某列</td>
        </tr>
		<tr>
          <th><a href="#unLockColumn">unLockColumn</a></th>
          <td>field</td>
          <td>取消某列的锁定</td>
        </tr>
		<tr>
          <th><a href="#getColumns">getColumns</a></th>
          <td></td>
          <td>获取列配置信息</td>
        </tr>
		<tr>
          <th><a href="#getColumnList">getColumnList</a></th>
          <td></td>
          <td>获取包含所有列名的数组</td>
        </tr>
		<tr>
          <th><a href="#showColumn">showColumn</a></th>
          <td>field</td>
          <td>显示某一列</td>
        </tr>
		<tr>
          <th><a href="#hideColumn">hideColumn</a></th>
          <td>field</td>
          <td>隐藏某一列</td>
        </tr>
		<tr>
          <th><a href="#sortColumn">sortColumn</a></th>
          <td>field</td>
          <td>对某列排序</td>
        </tr>
		<tr>
          <th><a href="#expandRow">expandRow</a></th>
          <td>rid,content(可以是模板)</td>
          <td>扩展某行</td>
        </tr>
		<tr>
          <th><a href="#hideExpandRow">hideExpandRow</a></th>
          <td>rid</td>
          <td>关闭扩展某行</td>
        </tr>
		<tr>
          <th><a href="#destroyExpandRow">destroyExpandRow</a></th>
          <td>rid</td>
          <td>删除某行扩展</td>
        </tr>
		<tr>
          <th><a href="#updateExpandRow">updateExpandRow</a></th>
          <td>rid,content(可以是模板)</td>
          <td>更新某行扩展内容</td>
        </tr>
		<tr>
          <th><a href="#selectAllRows">selectAllRows</a></th>
          <td></td>
          <td>选择所有行</td>
        </tr>
		<tr>
          <th><a href="#unselectAllRows">unselectAllRows</a></th>
          <td></td>
          <td>取消选择所有行</td>
        </tr>
		<tr>
          <th><a href="#selectRow">selectRow</a></th>
          <td>rid</td>
          <td>选择某行</td>
        </tr>
		<tr>
          <th><a href="#unselectRow">unselectRow</a></th>
          <td>rid</td>
          <td>取消选择某行</td>
        </tr>
		<tr>
          <th><a href="#showGroup">showGroup</a></th>
          <td>groupID</td>
          <td>显示某分组(需要开启分组)</td>
        </tr>
		<tr>
          <th><a href="#hideGroup">hideGroup</a></th>
          <td>groupID</td>
          <td>隐藏某分组</td>
        </tr>
		<tr>
          <th><a href="#searchData">searchData</a></th>
          <td>text,field[,async,data]</td>
          <td>搜索数据,async true 本地搜索,false服务器搜索 </td>
        </tr>
		<tr>
          <th><a href="#clearSearch">clearSearch</a></th>
          <td></td>
          <td>取消搜索</td>
        </tr>
		<tr>
          <th><a href="#refreshData">refreshData</a></th>
          <td></td>
          <td>刷新表格</td>
        </tr>
		<tr>
          <th><a href="#refreshDataCache">refreshDataCache</a></th>
          <td></td>
          <td>刷新当前页</td>
        </tr>
		<tr>
          <th><a href="#C">C</a></th>
          <td>[key,value]</td>
          <td>设置或获取配置信息</td>
        </tr>
		<tr>
          <th><a href="#addData">addData</a></th>
          <td>Array</td>
          <td>为grid添加数据,添加后会立即刷新表格</td>
        </tr>
		<tr>
          <th><a href="#updateData">updateData</a></th>
          <td>Array</td>
          <td>更新grid数据,更新后会立即刷新表格</td>
        </tr>
		<tr>
          <th><a href="#deleteData">deleteData</a></th>
          <td>Array</td>
          <td>删除grid数据,删除后会立即刷新表格</td>
        </tr>
		<tr>
          <th><a href="#setFieldWidth">setFieldWidth</a></th>
          <td>field,width</td>
          <td>设置列宽，支持百分比</td>
        </tr>
		<tr>
          <th><a href="#addRow">addRow</a></th>
          <td>rowData,ai</td>
          <td>追加一行,ai : true默认自动识别是否超过pageSize,false:不识别直接追加一行</td>
        </tr>
		<tr>
          <th><a href="#updateRow">updateRow</a></th>
          <td>rid,data</td>
          <td>更新某行</td>
        </tr>
		<tr>
          <th><a href="#deleteRow">deleteRow</a></th>
          <td>rid</td>
          <td>删除某行</td>
        </tr>
		<tr>
          <th><a href="#metaData">metaData</a></th>
          <td>data</td>
          <td>添加元数据:json_data</td>
        </tr>
		<tr>
          <th><a href="#updateGrid">updateGrid</a></th>
          <td>Array</td>
          <td>更新当前页gird数据并显示</td>
        </tr>
		<tr>
          <th><a href="#scrollToField">scrollToField</a></th>
          <td>field</td>
          <td>滚动到列</td>
        </tr>
		<tr>
          <th><a href="#scrollToRow">scrollToRow</a></th>
          <td>rid</td>
          <td>滚动到某行</td>
        </tr>
		<tr>
          <th><a href="#hideHeader">hideHeader</a></th>
          <td></td>
          <td>隐藏列头</td>
        </tr>
		<tr>
          <th><a href="#showHeader">showHeader</a></th>
          <td></td>
          <td>显示列头</td>
        </tr>
		<th class="separate" colspan="3"><abbrev>可编辑Grid扩展API(默认this都指向grid本身)</abbrev></th>
		<tr>
          <th><a href="#getEditCellValue">getEditCellValue</a></th>
          <td>rid,field</td>
          <td>获取编辑状态下的编辑内容</td>
        </tr>
		<tr>
          <th><a href="#checkEditCell">checkEditCell</a></th>
          <td>rid,field</td>
          <td>验证当前编辑单元内容是否正确</td>
        </tr>
		<tr>
          <th><a href="#editCell">editCell</a></th>
          <td>rid,field</td>
          <td>编辑某单元格</td>
        </tr>
		<tr>
          <th><a href="#saveEditCell">saveEditCell</a></th>
          <td>[rid,field]</td>
          <td>保存并验证正处于编辑状态的单元格,没指定rid,field则保存所有正处于编辑中的单元格该函数会触发onCellEdit<br>
		  返回成功保存的单元格数据eg:
		  [ {rid:1,field:'name'} ]
		  </td>
        </tr>
		<tr>
          <th><a href="#unEditCell">unEditCell</a></th>
          <td>rid,field</td>
          <td>不做任何保存，以及验证，直接取消当前单元格的编辑状态</td>
        </tr>
		<tr>
          <th><a href="#unEditCell">unEditCell</a></th>
          <td>[rid,field]</td>
          <td>不做任何保存，以及验证，直接取消当前单元格的编辑状态,没指定rid,field则取消所有正处于编辑中的单元格</td>
        </tr>
		<tr>
          <th><a href="#editCell">editRow</a></th>
          <td>rid</td>
          <td>编辑某行</td>
        </tr>
		<tr>
          <th><a href="#checkEditRow">checkEditRow</a></th>
          <td>rid</td>
          <td>验证当前编辑行是否有没通过的单元格</td>
        </tr>
		<tr>
          <th><a href="#saveEditRow">saveEditRow</a></th>
          <td>rid</td>
          <td>保存当前行，返回成功验证并保存的单元格数组eg:[ {rid:1,field:'name'} ]<br>
		  	改函数会触发onRowEdit事件 回调函数可接受参数:rid,rowData,successSave(eg:[ {rid:1,field:'name'} ])
		  </td>
        </tr>
		<tr>
          <th><a href="#unEditRow">unEditRow</a></th>
          <td>rid</td>
          <td>不做任何保存，以及验证取消当前行的编辑</td>
        </tr>
      </tbody>
    </table>
</div>
</body>
</html>
